package entities;

import it.randomtower.engine.entity.Entity;
import entities.base.AbstractPlayer;

/**
 * Transparente Wand im Spiel, z.b als Rand der Kamera.
 * 
 * @author Benjamin
 */
public class Border extends Entity {

	public Border(String name, float x, float y, int width, int height) {
		super(x, y);
		this.name = name;
		depth = 1;
		addType(Entity.SOLID_PLAYER_ONLY);
		setHitBox(0, 0, width, height);
	}

	@Override
	public void collisionResponse(Entity other) {
		if (other instanceof AbstractPlayer) {
			AbstractPlayer player = (AbstractPlayer) other;
			System.out.println(player.x + " - " + x);
			if (player.x + 5 > x) {
				player.x += 3;
				System.out.println("player +3");
			} else {
				System.out.println("player -3");
				player.x -= 3;
			}
		}
	}

}
